This scenario demonstrates how to use semantic deduplication (contentId attribute) to selectively (per binding element) notify the system which binding should be ignored.


Content Deduplication

Content deduplication is accomplished by assigning an ID to a specific tile size binding in a notification's XML payload. This ID is the contentId attribute of the binding element. If a notification is received that contains a binding with a contentID that matches the contentId of a currently displayed or queued notification, that particular binding is ignored. The remaining bindings are processed normally.

The primary scenario for content deduplication is support of Square310x310 templates that can display the equivalent of three Wide310x150 tiles, as demonstrated below. In the example, four notifications will be sent to a tile which has its queue enabled, allowing notifications to cycle on the tile. The first notification contains a main story (A) and the next three notifications contain three associated stories (B, C, and D). The last three notifications are consolidated into a Square310x310 tile. The content of each notification and each binding contained within it is as follows:

Notification 1
Square: A
Wide: A
Large: A

Notification 2
Square: B
Wide: B
Large: B C D

Notification 3
Square: C
Wide: C
Large: B C D

Notification 4
Square: D
Wide: D
Large: B C D

Because the content of the large binding is identical in the last three notifications, that binding is assigned a contentId in notifications 2, 3, and 4. This causes the large binding in notifications 3 and 4 to be ignored. If the user has set the tile to its small or wide size, content A, B, C, and D cycles separately. If the user has set the tile to its large size, content A only cycles with the consolidated B, C, and D content. If you did not set a contentId, the large tile would animate with each new refresh, even though its content would remain unchanged. Note that the large binding in notification 1 would have either a different contentId or no contentId at all.
In this scenario, you send four different notifications, but because the large (Square310x310) binding has the same contentId in the last three notifications, the redundant bindings are deduplicated. This results in the large tile cycling between only two notifications instead of four.

First, enable the notification queue. This can be done for individual tile sizes, but in this example we enable it for all sizes.



Next, send all four notifications. Go to the Start screen and notice that when you choose the small or wide tile size, the tile cycles between four sets of content. Change to the large tile size and note that the tile cycles between just two sets of content.
In this example, we also use notification tags, which allow us to selectively replace specific notifications in the queue.